class Solution(object):
    def longestCommonPrefix(self, strs):
        """
        :type strs: List[str]
        :rtype: str
        """
        if not strs:
            return ''
        res = strs[0]
        i = 1
        for i in range(1,len(strs)):
            while strs[i].find[res] != 0:
                res = res[0:len(res)-1]
        return res


def main():
    strs = input('strs = ')
    Solution().longestCommonPrefix(strs)
if __name__ == '__main__':
    main()